<template>
	<view class="content">
		<le-audio 
			:activeIndex="audioActiveIndex" 
			:audioData="audioList" 
			:autoplay="true"
			:showAudioListIcon="showAudioListIcon" 
			:showAudioSpeedIcon="showAudioSpeedIcon"
			@onOpenAudioList="onOpenAudioList"
			@onAudioChange="onAudioChange"
		></le-audio>
	</view>
</template>
<script setup>
	import {
		ref
	} from "vue"
	import {
		onLoad
	} from '@dcloudio/uni-app';
	const audioActiveIndex = ref(0)
	const audioNum = ref(1)
	const audioList = ref([])
	const showAudioListIcon = ref(false)
	const showAudioSpeedIcon = ref(true)
	onLoad(() => {
		setTimeout(()=>{
			audioList.value.push(...[{
				title: '音频标题',
				epname:'专辑名',
				singer:'歌手名',
				image:'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
				fileUrl:'http://96.ierge.cn/15/238/477410.mp3'
			},{
				title: '123',
				epname:'456',
				singer:'789',
				image:'https://web-assets.dcloud.net.cn/unidoc/zh/uni.png',
				fileUrl: 'https://bjetxgzv.cdn.bspapp.com/VKCEYUGU-hello-uniapp/2cc220e0-c27a-11ea-9dfb-6da8e309e0d8.mp3'
			}])
		},1000)
	})
	// 切换音频
	const onAudioChange = (data, index) => {
		audioActiveIndex.value = index;
	}
	// 点击打开按钮
	const onOpenAudioList = () => {
		console.log("点击打开按钮")
	}
</script>

<style>
	.content {
		padding-top: 200rpx;
	}
</style>